package request

import (
	"gitee.com/cjsn/topsdk/util"
)

type TmallServicecenterAnomalyrecourseHomedecorationCreateRequest struct {
	/*
	   工单ID     */
	WorkcardId *int64 `json:"workcard_id" required:"true" `
	/*
	   问题code     */
	QuestionCode *string `json:"question_code" required:"true" `
	/*
	   投诉描述     */
	Remark *string `json:"remark" required:"true" `
	/*
	   是否有消费者投诉风险0：无；1：有     */
	PublicOpinion *int64 `json:"public_opinion,omitempty" required:"false" `
	/*
	   投诉图片url     */
	Images *[]string `json:"images,omitempty" required:"false" `
	/*
	   投诉份数     */
	ComplainCount *int64 `json:"complain_count,omitempty" required:"false" `
	/*
	   申请赔付金额     */
	ApplyCompensationAmount *int64 `json:"apply_compensation_amount,omitempty" required:"false" `
}

func (s *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest) SetWorkcardId(v int64) *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest {
	s.WorkcardId = &v
	return s
}
func (s *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest) SetQuestionCode(v string) *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest {
	s.QuestionCode = &v
	return s
}
func (s *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest) SetRemark(v string) *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest {
	s.Remark = &v
	return s
}
func (s *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest) SetPublicOpinion(v int64) *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest {
	s.PublicOpinion = &v
	return s
}
func (s *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest) SetImages(v []string) *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest {
	s.Images = &v
	return s
}
func (s *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest) SetComplainCount(v int64) *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest {
	s.ComplainCount = &v
	return s
}
func (s *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest) SetApplyCompensationAmount(v int64) *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest {
	s.ApplyCompensationAmount = &v
	return s
}

func (req *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest) ToMap() map[string]interface{} {
	paramMap := make(map[string]interface{})
	if req.WorkcardId != nil {
		paramMap["workcard_id"] = *req.WorkcardId
	}
	if req.QuestionCode != nil {
		paramMap["question_code"] = *req.QuestionCode
	}
	if req.Remark != nil {
		paramMap["remark"] = *req.Remark
	}
	if req.PublicOpinion != nil {
		paramMap["public_opinion"] = *req.PublicOpinion
	}
	if req.Images != nil {
		paramMap["images"] = util.ConvertBasicList(*req.Images)
	}
	if req.ComplainCount != nil {
		paramMap["complain_count"] = *req.ComplainCount
	}
	if req.ApplyCompensationAmount != nil {
		paramMap["apply_compensation_amount"] = *req.ApplyCompensationAmount
	}
	return paramMap
}

func (req *TmallServicecenterAnomalyrecourseHomedecorationCreateRequest) ToFileMap() map[string]interface{} {
	fileMap := make(map[string]interface{})
	return fileMap
}
